<section id="content">
	<!-- Docs page layout -->

	<div id="container" class="transitions-enabled infinite-scroll clearfix">
		<?php
		
		if ($sort_time == null) {
			echo 'No record!';
		} else {
			$i=1;
			foreach ($sort_time as $row) {
				//echo $row -> description .'("'.$row->use_tag_Id.'")'. '<br/>';
				$v_random = rand(1,5); // random class in css
				$col = "";
				switch ($v_random) {
					case 1:
					$col= "box col1";
					break;
					case 2:
					$col= "box col2";
					break;
					case 3:
					$col= "box col3";
					break;
					case 4:
					$col= "box col4";
					break;
					default:
					$col= "box col5";
					break;
				}
				?>

				<<div class="<?php echo $col; ?>">
				<?php
				if ($row -> img_path == "" || $row -> img_path == NULL) {
					echo '<p>' . $row -> description . '</p>';

				} else {

					echo '<a href="#test-modal" class="popup-modal" row_des="'.$row -> description.'" row_img="'.$row -> img_path.'""><img src="' . $row -> img_path . '" /></a>';
					echo '<span class="caption simple-caption">';

					echo '<p>' ;
					$str = $row -> description;
					// condition on string length
					if (strlen($str) > 40){
						$str = substr($str, 0, 30) . '...';
					}else{
						$str = substr($str, 0, 30) . '...';
					}
					echo $str;
					echo '</p>';
					echo '</span>';
				}
				?>
			</div>

			<?php
			$i++;
		}
	}
	?>
</div>

</section>